#ifndef HB_OPTICAL_FLOW_H
#define HB_OPTICAL_FLOW_H

#include <stdint.h>


#define PARAM_IMAGE_WIDTH		1920
#define PARAM_IMAGE_HEIGHT		1080
#define FRAME_SIZE	  			PARAM_IMAGE_WIDTH//image width
#define SEARCH_SIZE	 			16 										//maximum offset to search
#define TILE_SIZE				8               						// x & y tile size
#define NUM_BLOCKS				5                                      // x & y number of tiles to check


#define PARAM_BOTTOM_FLOW_FEATURE_THRESHOLD		40
#define PARAM_BOTTOM_FLOW_VALUE_THRESHOLD 		5000
#define PARAM_USB_SEND_VIDEO					0
#define PARAM_BOTTOM_FLOW_HIST_FILTER			0
#define PARAM_FOCAL_LENGTH_MM					(4.5f)//h20
#define PARAM_BOTTOM_FLOW_GYRO_COMPENSATION		0
#define PARAM_GYRO_COMPENSATION_THRESHOLD		(0.01f)
#define TIME_BETWEEN_IMAGES						(0.033f)  // 1/ 30  uint:s
#define PARAM_BOTTOM_FLOW_WEIGHT_NEW			(0.3f)



/**
 * @brief Computes pixel flow from image1 to image2
 *
 * Searches the corresponding position in the new image (image2) of max. 64 pixels from the old image (image1)
 * and calculates the average offset of all.
 *
 * @param image1  previous image buffer
 * @param image2  current (new) image buffer
 * @param x_rate  gyro x rate
 * @param y_rate  gyro y rate
 * @param z_rate  gyro z rate
 *
 * @return        quality of flow calculation
 */
uint8_t compute_flow(uint8_t *image1, uint8_t *image2, float x_rate, float y_rate, float z_rate, float *pixel_flow_x, float *pixel_flow_y) ;



#endif //HB_OPTICAL_FLOW_H

